<template>
  <div>
    <a-form>
      <a-form-item label="account">
        <a-input
          v-decorator="[
            'account',
            { rules: [{ required: true, message: '请输入账号' }] },
          ]"
        />
      </a-form-item>
      <a-form-item label="pwd">
        <a-input
          v-decorator="[
            'pwd',
            { rules: [{ required: true, message: '请输入密码' }] },
          ]"
        />
      </a-form-item>

      <a-form-item :wrapper-col="{ span: 12, offset: 5 }">
        <a-button type="primary" html-type="submit" @click="handleSubmit">
          登陆
        </a-button>
      </a-form-item>
    </a-form>
  </div>
</template>

<script>
import { login } from "@/api/login.js";
export default {
  methods: {
    handleSubmit() {
      login({
        account: "123456",
        pwd: "123456",
      }).then((res) => {
        const data = res.data;
        if (res.data.status == "1") {
          localStorage.setItem("account", JSON.stringify(data.data));

          this.$router.replace("/home");
        }
      });
      //   MnLogin().then((res) => {
      //     if (res.data.status == "1") {
      //       this.$router.replace("/home");
      //     }
      //   });
    },
  },
};
</script>

<style></style>